package com.yixin.hospital.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum MessageStatusEnum {
    UNREAD(0, "未读"),
    READ(1, "已读"),
    ;

    private final Integer code;
    private final String msg;

    public static String getDesc(Integer code) {
        for (MessageStatusEnum messageTypeEnum : MessageStatusEnum.values()) {
            if (Objects.equals(messageTypeEnum.getCode(), code)) {
                return messageTypeEnum.getMsg();
            }
        }
        return "";
    }
}

